package at.fhv.androideightpuzzle.domain;

public class EightPuzzle {
	
	private String m_puzzleId;
	private PuzzleBoard m_puzzleBoard;
	
	public EightPuzzle(String puzzleId,PuzzleBoard puzzleBoard){
		m_puzzleId=puzzleId;
		m_puzzleBoard=puzzleBoard;	
	}
	
	public boolean isFinished(){
		if(m_puzzleBoard!=null){
			return m_puzzleBoard.isFinished();
		}else{
			return false;
		}
	}
	
	public int[][] swapEmptyPart(SwapDirection swapDirection){
		if(m_puzzleBoard!=null){
			return m_puzzleBoard.swapEmptyPart(swapDirection);
		}else{
			return null;
		}
	}
	
	public int[][] swapPart(Position position){
		if(m_puzzleBoard!=null){
			return m_puzzleBoard.swapPart(position);
		}else{
			return null;
		}
	}
	
	public void shuffle(){
		if(m_puzzleBoard!=null){
			m_puzzleBoard.shuffle();
		}
	}
	
	public int[] getEndState(){
		return m_puzzleBoard.getEndState();
	}
	
	public PuzzlePart[][] getPuzzleParts(){
		if(m_puzzleBoard!=null){
			return m_puzzleBoard.getParts();
		}else{
			return null;
		}
	}
	
	public int[][] getState(){
		if(m_puzzleBoard!=null){
			return m_puzzleBoard.getState();
		}else{
			return null;
		}
	}
	
	public String getPuzzleId(){
		return m_puzzleId;
	}
	
	public PuzzleBoard getPuzzleBoard(){
		return m_puzzleBoard;
	}
}
